<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        $stu[]="张三";  //  键     0
        $stu[]="男";   //          1
        //echo $stu[1];
        
        $arr=array("李四","男","18","桂林");  //下标都是整型  索引数组
        //echo $arr[3];
        
        
        //练习：定义一个数组，  苹果   香蕉   柚子     芒果     梨
        $ff[]="苹果";    //0
        $ff[]="香蕉";   //1
        $ff[]="柚子";   //2
        $ff[]="芒果";   //3
        $ff[]="梨";    //4        
        //echo $ff[2];
        for($i=0;$i<count($ff);$i++)
        {
           echo $ff[$i]."<br/>"; 
        }
        
        
        $hh=array("苹果","香蕉","柚子","芒果","梨");
        //echo $hh[2];
        
        //关联数组
        $info=array("id"=>1,"name"=>"李四","major"=>"计算机应用技术");
       // echo $info["major"];
        
        $kk["a1"]="苹果";    //
        $kk["b1"]="香蕉";   //
        $kk["c1"]="柚子";   //
        $kk["d1"]="梨"; 
        foreach($kk as $key=>$value)
        {
           echo $value."<br/>";
        }
        ?>
    </body>
</html>
